package demo.set;

public class MyObject {
  private int value;
  
  public MyObject(int value) {
    this.value=value;
  }
  
  @Override
	public boolean equals(Object obj) {
	  System.out.println("equals method called.");
	  MyObject myObject=(MyObject)obj;
	  
	  return this.value==myObject.value;
	  
	}
  
  @Override
	public int hashCode() {
		System.out.println("hashCodeCalled.");
	return this.value;
	}
  
  @Override
	public String toString() {
		// TODO Auto-generated method stub
		return  "ObjectClassAbc" +"#"+hashCode();
		
	}
}
